﻿Imports KOR.Helpers

Namespace BL


    Public Module TapeWidths


#Region "TapeWidths_DML"

        Public Function InsertTapeWidth(dict As Dictionary(Of String, Object)) As Integer
            Return DDA.Insert("TapeWidths", dict)
        End Function

        Public Function UpdateTapeWidth(dict As Dictionary(Of String, Object), TapeWidthID As Integer) As Integer
            Return DDA.Update("TapeWidths", dict, "TapeWidthID=" & TapeWidthID)
        End Function

        Public Function DeleteTapeWidth(ByVal TapeWidthID As Integer) As Integer
            Return DDA.Delete("TapeWidths", "TapeWidthID=" & TapeWidthID, False)
        End Function

#End Region

#Region "TapeWidths_Selection"

        Public Function GetAllTapeWidths() As IDataReader
            Dim sql As String = "SELECT * FROM TapeWidths Order By TapeWidthID DESC"
            Return DDA.SelectData(sql)
        End Function

        Public Function GetTapeWidths(searchFor As String, criteria As String, startRowIndex As Integer, maximumRows As Integer, SortBy As String) As IDataReader
            Dim sql As String
            sql = "SELECT * FROM TapeWidths "

            If SortBy = "" Then SortBy = " CreatedDate Desc"

            Return DDA.SelectDataPaginated(sql, startRowIndex, maximumRows, SortBy)
        End Function

        Public Function TapeWidthsCount(searchFor As String, criteria As String) As Integer
            Dim sql As String
            sql = "SELECT * FROM TapeWidths "
            Return DDA.SelectDataCount(sql)
        End Function

#End Region



    End Module

End Namespace
